home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_1 / pubdom.tar / pubdom / e_vogel / deltat next >
Text File  |  1990-05-19  |  3KB  |  42 lines

  1. %%HP: T(3)A(D)F(.);                        @ DELTAT: subtract two points on a
  2.                                            @ temperature scale, and get a 
  3.                                            @ temperature increment.
  4. \<<                                        @ tpt2 tpt1 ->
  5.   \-> tpt2 tpt1                            @ Save arguments (user-defined 
  6.                                            @ function structure allows DELTAT
  7.                                            @ to be used in an algebraic)
  8.   \<<                                      @ ->
  9.     tpt2 tpt1                              @ Restore arguments
  10.                                            @ tpt2 tpt1 ->
  11.     IF                                     @ Check for real arguments
  12.       DUP2                                 @ tpt2 tpt1 tpt2 tpt1 ->
  13.       TYPE                                 @ tpt2 tpt1 tpt2 TYPE(tpt1) ->
  14.       SWAP TYPE                            @ tpt2 tpt1 TYPE(tpt1) TYPE(tpt2) ->
  15.       +                                    @ Sum will be zero if both real ->
  16.                                            @ tpt2 tpt1 0/nonzero ->
  17.     THEN                                   @ Not 0: assume 2 pure temperatures
  18.                                            @ tpt2 tpt1 ->
  19.                                            @ To check for pure temperatures, 
  20.                                            @ call VFTOBJ or VFTERR here
  21.       OVER                                 @ tpt2 tpt1 tpt2 ->
  22.       CONVERT                              @ Convert tpt1 to tpt2 units
  23.                                            @ tpt2 tpt1' ->
  24.       UVAL                                 @ tpt2 N(tpt1') ->
  25.       SWAP                                 @ N(tpt1') tpt2 ->
  26.       OBJ\->                               @ Decompose tpt2
  27.                                            @ N(tpt1') N(tpt2) U(tpt2) ->
  28.       SWAP                                 @ N(tpt1') U(tpt2) N(tpt2) ->
  29.       ROT                                  @ U(tpt2) N(tpt2) N(tpt1') ->
  30.       -                                    @ Compute value for tinc
  31.                                            @ U(tpt2) N(tpt2)-N(tpt1') ->
  32.       SWAP                                 @ N(tpt2)-N(tpt1') U(tpt2) ->
  33.       \->UNIT                              @ Create unit object
  34.                                            @ deltat ->
  35.     ELSE                                   @ 0: 2 reals, so just subtract
  36.                                            @ tpt2 tpt1 ->
  37.       -                                    @ tpt2-tpt1 ->
  38.                                            @ deltat ->
  39.     END                                    
  40.   \>>
  41. \>>
  42.